<style tyle="text/css">
    .modal-lg {
        width: 80%;
    }
    .panel {
        margin-bottom: 0px;
    }
</style>
<div class="panel panel-default">
    <div class="modal-header">
        <h4 class="modal-title">机构列表</h4>
    </div>
    <div class="modal-body panel-body">
        <form name="form" class="form-horizontal form-validation ng-pristine ng-valid ng-valid-required">
            <table class="table table-striped table-bordered dataTable table-condensed tree_table" style="table-layout:fixed">
                <thead>
                    <tr>
                        <th class="col-md-1 text-center">补贴活动标识</th>
                        <th class="col-md-1 text-center">机构编号</th>
                        <th class="col-md-1 text-center">机构补贴活动总量</th>
                        <th class="col-md-1 text-center">机构补贴活动余量</th>
                        <th class="col-md-1 text-center">补贴活动状态</th>
                        <th class="col-md-1 text-center">单次领取数量</th>
                        <th class="col-md-1 text-center">补贴活动最大领取次数</th>
                        <th class="col-md-1 text-center">补贴活动数量单位</th>
                        <th class="col-md-1 text-center">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="company in companyList">
                        <td class="text-center">{{company.subsidy_id}}</td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="company.state">{{company.subsidy_company_code}}</span>
                            <input type="text" class="form-control" ng-model="company.subsidy_company_code" ng-show="!company.state">
                        </td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="company.state">{{company.subsidy_company_total}}</span>
                            <input type="number" class="form-control" ng-model="company.subsidy_company_total" ng-show="!company.state">
                        </td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="company.state">{{company.subsidy_company_num}}</span>
                            <input type="number" class="form-control" ng-model="company.subsidy_company_num" ng-show="!company.state">
                        </td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="company.state && company.subsidy_company_state == '1'">未开始</span>
                            <span ng-show="company.state && company.subsidy_company_state == '2'">进行中</span>
                            <span ng-show="company.state && company.subsidy_company_state == '3'">已结束</span>
                            <select class="form-control" ng-model="company.subsidy_company_state" ng-show="!company.state">
                                <option value="1">未开始</option>
                                <option value="2">进行中</option>
                                <option value="3">已结束</option>
                            </select>
                        </td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="company.state">{{company.subsidy_company_num_once}}</span>
                            <input type="number" class="form-control" ng-model="company.subsidy_company_num_once" ng-show="!company.state">
                        </td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="company.state">{{company.subsidy_company_nums_max}}</span>
                            <input type="number" class="form-control" ng-model="company.subsidy_company_nums_max" ng-show="!company.state">
                        </td>
                        <td class="text-center">
                            {{company.subsidy_conpany_unit == '1'? '人/次': '金额/分'}}
                        </td>
                        <td class="text-center">
                            <button type="button" class="btn btn-success btn-xs" ng-if="company.subsidy_company_state == '1'" ng-click="start(company)">开始</button>
                            <button type="button" class="btn btn-danger btn-xs" ng-if="company.subsidysubsidy_company_state_state == '2'" ng-click="end(company)">结束</button>
                            <button type="button" class="btn btn-info btn-xs" ng-if="!company.is_new" ng-click="save(company)">保存</button>
                            <button type="button" class="btn btn-info btn-xs" ng-if="company.is_new" ng-click="create(company)">保存</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </form>
    </div>
    <div class="modal-footer">
        <a class="btn btn-md btn-success" ng-click="add()">添加机构</a>
    </div>

</div>
<!-- <div class="col-sm-12 mt20">
    <div class="modal-header">
        <h4 class="modal-title">机构列表</h4>
        <button class="btn btn-info btn-block pull-roght" ng-click="add()">添加机构</button>
    </div>
    <div class="modal-body">
        <table class="table table-striped table-bordered dataTable table-condensed tree_table" style="table-layout:fixed">
            <thead>
                <tr>
                    <th class="col-md-1 text-center">补贴活动标识</th>
                    <th class="col-md-1 text-center">机构编号</th>
                    <th class="col-md-1 text-center">机构补贴活动总量</th>
                    <th class="col-md-1 text-center">机构补贴活动余量</th>
                    <th class="col-md-1 text-center">补贴活动状态</th>
                    <th class="col-md-1 text-center">单次领取数量</th>
                    <th class="col-md-1 text-center">补贴活动最大领取次数</th>
                    <th class="col-md-1 text-center">补贴活动数量单位</th>
                    <th class="col-md-1 text-center">操作</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="company in companyList">
                    <td class="text-center">{{company.subsidy_id}}</td>
                    <td class="text-center">
                        <input type="text" class="form-control" ng-model="company.subsidy_company_code" ng-dblclick="edit(company)" ng-disabled="company.state">
                    </td>
                    <td class="text-center">
                        <input type="number" class="form-control" ng-model="company.subsidy_company_total" ng-dblclick="edit(company)" ng-disabled="company.state">
                    </td>
                    <td class="text-center">
                        <input type="number" class="form-control" ng-model="company.subsidy_company_num" ng-dblclick="edit(company)" ng-disabled="company.state">
                    </td>
                    <td class="text-center">
                        <select class="form-control" ng-model="company.subsidy_company_state" ng-dblclick="edit(company)" ng-disabled="company.state">
                            <option value="1">开始次</option>
                            <option value="2">进行中</option>
                            <option value="3">已结束</option>
                        </select>
                    </td>
                    <td class="text-center">
                        <input type="number" class="form-control" ng-model="company.subsidy_company_num_once" ng-dblclick="edit(company)" ng-disabled="company.state">
                    </td>
                    <td class="text-center">
                        <input type="number" class="form-control" ng-model="company.subsidy_company_nums_max" ng-dblclick="edit(company)" ng-disabled="company.state">
                    </td>
                    <td class="text-center">
                        {{company.subsidy_conpany_unit == '1'? '人/次': '金额/分'}}
                    </td>
                    <td class="text-center">
                        <button type="button" class="btn btn-info btn-xs" ng-if="!company.is_new" ng-click="save(company)">保存</button>
                        <button type="button" class="btn btn-info btn-xs" ng-if="company.is_new" ng-click="create(company)">保存</button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div> -->